//
// Created by hjie on 23-6-3.
//

#pragma once

#include <cstring>
#include <string>
#include <unistd.h>
#include <vector>

class WriteBuffer
{
public:
    WriteBuffer(int buffer_size = 1024);
    ~WriteBuffer();
    void Write(const uint8_t * data, int length);
    void Write(uint8_t  data);
    void Write(uint16_t data);
    void Write(uint32_t data);
    void Write(uint64_t data);
    uint8_t * Data();
    size_t Length();
    void RemoveSize(int size);
    void Clear();
private:
    std::vector<uint8_t> m_buffer;
    int m_data_length;
};

